package com.snj.test;

import java.time.LocalDate;

public class DateComparison {

    public static boolean isDateGreaterThanNow(String dateString) {
        // 将传入的字符串转换为 LocalDate
        LocalDate inputDate = LocalDate.parse(dateString);
        // 获取当前日期
        LocalDate currentDate = LocalDate.now();

        // 判断传入日期是否大于当前日期
        return inputDate.isAfter(currentDate);
    }

    public static void main(String[] args) {
        // 测试
        String testDate = "2024-10-13";
        boolean result = isDateGreaterThanNow(testDate);
        System.out.println(result);
        if (result) {
            System.out.println("改时间大于当前时间: " + testDate);
        } else {
            System.out.println("改时间小于当前时间: " + testDate);
        }
    }
}